<?php

namespace App\Listeners\log;

use App\Events\log\AllLog;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use DB;

class AllLogListener
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  AllLog  $event
     * @return void
     */
    public function handle(AllLog $event)
    {
        $data = $event->data;
        unset($data['parse'],$data['room_id'],$data['building_id'],$data['area_id'],$data['latitude'],$data['longitude'],$data['url']);
        DB::table('alllog')->insert($data);
    }
}